#!/bin/bash
# 备份/home目录到/backup目录

BACKUP_DIR="/home"
BACKUP_DEST="/backup"
DATE=$(date +%Y%m%d_%H%M%S)
TAR_FILE="$BACKUP_DEST/home_backup_$DATE.tar.gz"

tar -czf $TAR_FILE $BACKUP_DIR
echo "备份完成：$TAR_FILE"